package no.rmz.chez.game.reporters;

import no.rmz.chez.chess.board.ChessBoard;
import no.rmz.chez.chess.board.Color;
import no.rmz.chez.chess.pieces.ChessPiece;
import no.rmz.chez.game.Move;
import no.rmz.chez.misc.Timer;

/**
 * An interface for reporting the progress and result
 * of a game.
 *
 */
public interface GameReporter {
    
    
    /**
     * Setting the timer used to keep track of time used
     * by this game.
     */
    void setMyTimer(Timer t);
    

    /**
     * Log the move.
     * @param piece the piece being moved.
     * @param m  the move.
     * @param b  The chessboard (after the move).
     */
    void logMove(final int moveNo,
            final ChessPiece piece,
            final Move m,
            final ChessBoard b);

    /**
     * Report the result of the game to whoever is interested.
     *
     */
    void reportResult();

    /**
     * Report or whatever when a deadlock is detected.
     *
     */
    void reportDeadlock();

    /**
     * Handle a tie either because a player offers a tie, and
     * the other accepts, or because the game is not finished
     * when  the max number moves has been played.
     *
     */
    void reportTie();

    /**
     * Handle the termination of a game.
     * @param winner the terminal board.
     */
    void handleNormalTermination(final Color winner);

}
